package com.autonavi.collapse.task;

import com.autonavi.collapse.task.dispatch.TaskNode;
import com.autonavi.collapse.task.model.TaskConfig;
import com.autonavi.collapse.task.model.TaskRelation;
import com.autonavi.collapse.task.model.TaskResult;
import com.autonavi.collapse.task.model.TaskTemplate;

import java.util.List;

public interface TaskService {

    void init(String group, Object dataCenter);

    List<TaskConfig> findMyTask(String myName, int size);

    boolean setDispatched(String id, String myName);

    boolean setRunning(String id, String myName);

    boolean notify(TaskResult taskResult, String myName);

    int addTask(List<TaskConfig> taskConfigs);

    List<TaskTemplate> findTemplates(int size);

    boolean saveTemplateNextTime(TaskTemplate taskTemplate);

    List<TaskNode> findAvailableNodes();

    List<TaskNode> findDeadNodes();

    List<TaskConfig> findTasks(int size);

    boolean dispatch(TaskConfig taskConfig);

    boolean heartbeat(String myName, int freeSize, int timeout);

    List<TaskRelation> FindtaskRelations(int size);

    List<TaskConfig> findTasks(int size, String type);

    List<TaskConfig> findMyTask(String myName, String type, int size);

    List<String> findTaskTypeList();
}
